<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<title>Get influencers API | ElasticSearch 7.7 权威指南中文版</title>
	<meta name="keywords" content="ElasticSearch 权威指南中文版, elasticsearch 7, es7, 实时数据分析，实时数据检索" />
    <meta name="description" content="ElasticSearch 权威指南中文版, elasticsearch 7, es7, 实时数据分析，实时数据检索" />
    <!-- Give IE8 a fighting chance -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
	<link rel="stylesheet" type="text/css" href="../static/styles.css" />
	<script>
	var _link = 'ml-get-influencer.html';
    </script>
</head>
<body>
<div class="main-container">
    <section id="content">
        <div class="content-wrapper">
            <section id="guide" lang="zh_cn">
                <div class="container">
                    <div class="row">
                        <div class="col-xs-12 col-sm-8 col-md-8 guide-section">
                            <div style="color:gray; word-break: break-all; font-size:12px;">原英文版地址: <a href="https://www.elastic.co/guide/en/elasticsearch/reference/7.7/ml-get-influencer.html" rel="nofollow" target="_blank">https://www.elastic.co/guide/en/elasticsearch/reference/7.7/ml-get-influencer.html</a>, 原文档版权归 www.elastic.co 所有<br/>本地英文版地址: <a href="../en/ml-get-influencer.html" rel="nofollow" target="_blank">../en/ml-get-influencer.html</a></div>
                        <!-- start body -->
                  <div class="page_header">
<strong>重要</strong>: 此版本不会发布额外的bug修复或文档更新。最新信息请参考 <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/index.html" rel="nofollow">当前版本文档</a>。
</div>
<div id="content">
<div class="breadcrumbs">
<span class="breadcrumb-link"><a href="index.html">Elasticsearch Guide [7.7]</a></span>
»
<span class="breadcrumb-link"><a href="rest-apis.html">REST APIs</a></span>
»
<span class="breadcrumb-link"><a href="ml-apis.html">Machine learning anomaly detection APIs</a></span>
»
<span class="breadcrumb-node">Get influencers API</span>
</div>
<div class="navheader">
<span class="prev">
<a href="ml-get-datafeed-stats.html">« Get datafeed statistics API</a>
</span>
<span class="next">
<a href="ml-get-job.html">Get anomaly detection jobs API »</a>
</span>
</div>
<div class="section xpack">
<div class="titlepage"><div><div>
<h2 class="title">
<a id="ml-get-influencer"></a>Get influencers API<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/ml/anomaly-detection/apis/get-influencer.asciidoc">edit</a><a class="xpack_tag" href="https://www.elastic.co/subscriptions"></a>
</h2>
</div></div></div>

<p>Retrieves anomaly detection job results for one or more influencers.</p>
<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="ml-get-influencer-request"></a>Request<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/ml/anomaly-detection/apis/get-influencer.asciidoc">edit</a>
</h3>
</div></div></div>
<p><code class="literal">GET _ml/anomaly_detectors/&lt;job_id&gt;/results/influencers</code></p>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="ml-get-influencer-prereqs"></a>Prerequisites<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/ml/anomaly-detection/apis/get-influencer.asciidoc">edit</a>
</h3>
</div></div></div>
<div class="ulist itemizedlist">
<ul class="itemizedlist">
<li class="listitem">
If the Elasticsearch security features are enabled, you must have <code class="literal">monitor_ml</code>,
<code class="literal">monitor</code>, <code class="literal">manage_ml</code>, or <code class="literal">manage</code> cluster privileges to use this API. You also
need <code class="literal">read</code> index privilege on the index that stores the results. The
<code class="literal">machine_learning_admin</code> and <code class="literal">machine_learning_user</code> roles provide these
privileges. See <a class="xref" href="security-privileges.html" title="Security privileges">Security privileges</a> and
<a class="xref" href="built-in-roles.html" title="Built-in roles">Built-in roles</a>.
</li>
</ul>
</div>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="ml-get-influencer-desc"></a>Description<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/ml/anomaly-detection/apis/get-influencer.asciidoc">edit</a>
</h3>
</div></div></div>
<p>Influencers are the entities that have contributed to, or are to blame for,
the anomalies. Influencer results are available only if an
<code class="literal">influencer_field_name</code> is specified in the job configuration.</p>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="ml-get-influencer-path-parms"></a>Path parameters<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/ml/anomaly-detection/apis/get-influencer.asciidoc">edit</a>
</h3>
</div></div></div>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">&lt;job_id&gt;</code>
</span>
</dt>
<dd>
(Required, string)
Identifier for the anomaly detection job.
</dd>
</dl>
</div>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="ml-get-influencer-request-body"></a>Request body<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/ml/anomaly-detection/apis/get-influencer.asciidoc">edit</a>
</h3>
</div></div></div>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">desc</code>
</span>
</dt>
<dd>
(Optional, boolean)
If true, the results are sorted in descending order.
</dd>
<dt>
<span class="term">
<code class="literal">end</code>
</span>
</dt>
<dd>
(Optional, string) Returns influencers with timestamps earlier than this time.
</dd>
<dt>
<span class="term">
<code class="literal">exclude_interim</code>
</span>
</dt>
<dd>
(Optional, boolean)
If <code class="literal">true</code>, the output excludes interim results. By default, interim results are
included.
</dd>
<dt>
<span class="term">
<code class="literal">influencer_score</code>
</span>
</dt>
<dd>
(Optional, double) Returns influencers with anomaly scores greater than or equal
to this value.
</dd>
<dt>
<span class="term">
<code class="literal">page</code>.<code class="literal">from</code>
</span>
</dt>
<dd>
(Optional, integer) Skips the specified number of influencers.
</dd>
<dt>
<span class="term">
<code class="literal">page</code>.<code class="literal">size</code>
</span>
</dt>
<dd>
(Optional, integer) Specifies the maximum number of influencers to obtain.
</dd>
<dt>
<span class="term">
<code class="literal">sort</code>
</span>
</dt>
<dd>
(Optional, string) Specifies the sort field for the requested influencers. By
default, the influencers are sorted by the <code class="literal">influencer_score</code> value.
</dd>
<dt>
<span class="term">
<code class="literal">start</code>
</span>
</dt>
<dd>
(Optional, string) Returns influencers with timestamps after this time.
</dd>
</dl>
</div>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="ml-get-influencer-results"></a>Response body<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/ml/anomaly-detection/apis/get-influencer.asciidoc">edit</a>
</h3>
</div></div></div>
<p>The API returns an array of influencer objects, which have the following
properties:</p>
<div class="variablelist">
<dl class="variablelist">
<dt>
<span class="term">
<code class="literal">bucket_span</code>
</span>
</dt>
<dd>
(number)
The length of the bucket in seconds. This value matches the <code class="literal">bucket_span</code>
that is specified in the job.
</dd>
<dt>
<span class="term">
<code class="literal">influencer_score</code>
</span>
</dt>
<dd>
(number) A normalized score between 0-100, which is based on the probability of
the influencer in this bucket aggregated across detectors. Unlike
<code class="literal">initial_influencer_score</code>, this value will be updated by a re-normalization
process as new data is analyzed.
</dd>
<dt>
<span class="term">
<code class="literal">influencer_field_name</code>
</span>
</dt>
<dd>
(string) The field name of the influencer.
</dd>
<dt>
<span class="term">
<code class="literal">influencer_field_value</code>
</span>
</dt>
<dd>
(string) The entity that influenced, contributed to, or was to blame for the
anomaly.
</dd>
<dt>
<span class="term">
<code class="literal">initial_influencer_score</code>
</span>
</dt>
<dd>
(number) A normalized score between 0-100, which is based on the probability of
the influencer aggregated across detectors. This is the initial value that was
calculated at the time the bucket was processed.
</dd>
<dt>
<span class="term">
<code class="literal">is_interim</code>
</span>
</dt>
<dd>
(boolean)
If <code class="literal">true</code>, this is an interim result. In other words, the results are calculated
based on partial input data.
</dd>
<dt>
<span class="term">
<code class="literal">job_id</code>
</span>
</dt>
<dd>
(string)
Identifier for the anomaly detection job.
</dd>
<dt>
<span class="term">
<code class="literal">probability</code>
</span>
</dt>
<dd>
(number) The probability that the influencer has this behavior, in the range 0
to 1. This value can be held to a high precision of over 300 decimal places, so
the <code class="literal">influencer_score</code> is provided as a human-readable and friendly
interpretation of this.
</dd>
<dt>
<span class="term">
<code class="literal">result_type</code>
</span>
</dt>
<dd>
(string) Internal. This value is always set to <code class="literal">influencer</code>.
</dd>
<dt>
<span class="term">
<code class="literal">timestamp</code>
</span>
</dt>
<dd>
(date)
The start time of the bucket for which these results were calculated.
</dd>
</dl>
</div>
<div class="note admon">
<div class="icon"></div>
<div class="admon_content">
<p>Additional influencer properties are added, depending on the fields being
analyzed. For example, if it’s analyzing <code class="literal">user_name</code> as an influencer, then a
field <code class="literal">user_name</code> is added to the result document. This information enables you to
filter the anomaly results more easily.</p>
</div>
</div>
</div>

<div class="section">
<div class="titlepage"><div><div>
<h3 class="title">
<a id="ml-get-influencer-example"></a>Examples<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elastic/elasticsearch/edit/7.7/docs/reference/ml/anomaly-detection/apis/get-influencer.asciidoc">edit</a>
</h3>
</div></div></div>
<div class="pre_wrapper lang-console">
<pre class="programlisting prettyprint lang-console">GET _ml/anomaly_detectors/high_sum_total_sales/results/influencers
{
  "sort": "influencer_score",
  "desc": true
}</pre>
</div>
<div class="console_widget" data-snippet="snippets/1823.console"></div>
<p>In this example, the API returns the following information, sorted based on the
influencer score in descending order:</p>
<div class="pre_wrapper lang-js">
<pre class="programlisting prettyprint lang-js">{
  "count": 189,
  "influencers": [
    {
      "job_id": "high_sum_total_sales",
      "result_type": "influencer",
      "influencer_field_name": "customer_full_name.keyword",
      "influencer_field_value": "Wagdi Shaw",
      "customer_full_name.keyword" : "Wagdi Shaw",
      "influencer_score": 99.02493,
      "initial_influencer_score" : 94.67233079580171,
      "probability" : 1.4784807245686567E-10,
      "bucket_span" : 3600,
      "is_interim" : false,
      "timestamp" : 1574661600000
    },
  ...
  ]
}</pre>
</div>
</div>

</div>
<div class="navfooter">
<span class="prev">
<a href="ml-get-datafeed-stats.html">« Get datafeed statistics API</a>
</span>
<span class="next">
<a href="ml-get-job.html">Get anomaly detection jobs API »</a>
</span>
</div>
</div>

                  <!-- end body -->
                        </div>
                        <div class="col-xs-12 col-sm-4 col-md-4" id="right_col">
                        
                        </div>
                    </div>
                </div>
            </section>
        </div>
    </section>
</div>
<script src="../static/cn.js"></script>
</body>
</html>